<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			input{
				width: 100px;
				height: 40px;
				margin: 10px;
				border: 2px solid royalblue;
				font-size: 30px;
				text-align: center;
			}
		</style>
	</head>
	<body>
		<input type="button"  value="-" onclick="jian()" />
		<input type="text"  value="0" />
		<input type="button" value="+" onclick="jia()" />
	</body>
	<script type="text/javascript">
		var x = 0;
		var btns = document.getElementsByTagName("input");
		
		function jia(){
			++x;
			btns[1].value = x;
		}
		function jian(){
			--x;
			btns[1].value = x;
		}
		

		
	</script>
</html>
